package com.tc.controller;

import com.tc.dto.Result;
import com.tc.myDto.BusinessInformation;
import com.tc.myDto.UserApp;
import com.tc.service.PersonalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

@RestController
@RequestMapping("/my")
public class PersonalController {
    @Autowired
    private PersonalService personalService;

    //注册商家
    @PostMapping("/addBusiness")
    public Result addBusiness(@RequestBody BusinessInformation businessInformation,HttpServletRequest request){
        return personalService.addBusiness(businessInformation,request);
    }

    //修改个人信息
    @PutMapping("/updateUserApp")
    public Result updateUserApp(@RequestBody UserApp user){
        return personalService.updateUserApp(user);
    }

    //获取个人信息
    @GetMapping("/selectInformation/{id}")
    public UserApp selectInformation(@PathVariable Integer id){
        return personalService.selectInformaion(id);
    }

}
